<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>

<script>
    var now = new Date(); //当前日期
    var nowMonth = now.getMonth(); //当前月
    var nowYear = now.getFullYear(); //当前年
    //本月的开始时间
    var monthStartDate = new Date(nowYear, nowMonth, 1);
    //本月的结束时间
    var monthEndDate = new Date(nowYear, nowMonth+1, 0);
    var timeStar=Date.parse(monthStartDate)/1000;//s
    var timeEnd=Date.parse(monthEndDate)/1000;//s
    console.log("本月开始时间",monthStartDate);
    console.log("timeStar",monthEndDate);
    console.log("timeEnd",monthStartDate);

    console.log("===================");
    console.log("getMonth",now.getMonth());
    console.log("getDay",now.getDay());


</script>
</html>